//package com.huc.rabbit.mq.config;
//
//import org.springframework.amqp.core.Binding;
//import org.springframework.amqp.core.BindingBuilder;
//import org.springframework.amqp.core.Queue;
//import org.springframework.amqp.core.TopicExchange;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * 主题模式
// */
//@Configuration
//public class RabbitTopicMQConfig {
//
//    public static final String QUEUE_NAME_A = "seckill.goods.A";
//    public static final String QUEUE_NAME_B = "seckill.goods.B";
//    public static final String EXCHANGE_NAME = "seckill.exchange";
//
//    public static final String QUEUE_KEY_B = "seckill.b.key";
//    public static final String QUEUE_KEY = "seckill.#";
//
//    @Bean
//    public Queue queueA(){
//        return new Queue(QUEUE_NAME_A);
//    }
//
//    @Bean
//    public Queue queueB(){
//        return new Queue(QUEUE_NAME_B);
//    }
//
//    /**
//     * 主题模式
//     * @return
//     */
//    @Bean
//    public TopicExchange exchange(){
//        return new TopicExchange(EXCHANGE_NAME);
//    }
//
//    @Bean
//    public Binding bindingQueueA2TopicExchange(Queue queueA,TopicExchange exchange){
//        return BindingBuilder.bind(queueA).to(exchange).with(QUEUE_KEY);
//    }
//
//    @Bean
//    public Binding bindingQueueB2TopicExchange(Queue queueB,TopicExchange exchange){
//        return BindingBuilder.bind(queueB).to(exchange).with(QUEUE_KEY_B);
//    }
//
//}
